<!DOCTYPE html>
<canvas id="canvas" width="100" height="100"></canvas>
<script>
var source = document.createElement('canvas');
source.width = 50;
source.height = 50;
var sCtx = source.getContext('2d');
sCtx.fillStyle = '#FF0000';
sCtx.fillRect(0, 0, 50, 50);

var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
ctx.scale(1.5, 0.5);
ctx.rotate(10 * Math.PI / 180);
ctx.drawImage(source, 0, 0, 50, 50, 10, 10, 80, 80);
</script>
